#include <iostream>
using namespace std;
int maxComFactor(int a, int b)
{
    int n = a>b ? b: a;
    int mcf = 1;
    for (int i = 1; i <=n; i++)
    {
        if(a%i == 0 && b %i == 0)
        {
            if(i>mcf)
                mcf = i;
        }
    }
    return mcf;
}

int maxComFactor2(int a, int b)
{
    int temp;
    if(a<b)
    {
        temp  = a;
        a = b;
        b = temp;
    }
    if(b == 0)
        return a;
    else
        return maxComFactor(a%b,b);
}

int main()
{
 //cout<<maxComFactor(17,13);
 // return 0;
   int a1,b1,a2,b2;
   char c;
   cin>>a1>>c>>b1>>a2>>c>>b2;
   //cout<<a1<<"/"<<b1<<" "<<a2<<"/"<<b2;
   int numerator = a1 * b2 + a2 * b1;
   int denominator  = b1 * b2;
   int maxCommFactor = maxComFactor(numerator,denominator);
   cout<<numerator/maxCommFactor;
   if(denominator/maxCommFactor != 1)
        cout<<"/"<<denominator/maxCommFactor;
}